export default function (store) {
  if (localStorage.state) {
    const localStor = JSON.parse(localStorage.state)
    store.replaceState(Object.assign({}, store.state, localStor))
  }
  store.subscribe((mutaions, state) => {
    localStorage.state = JSON.stringify(state)
  })
}
 